import http from "@/http";
import type {AssingTreeParam, MenuType} from "@/api/menu/MenuModel.ts";

export const getParentApi = () => {
    return http.get("api/sysMenu/getParent")
}

export const addApi = (param: MenuType) => {
    return http.post('api/sysMenu/add', param)
}

export const getListApi = () => {
    return http.get('api/sysMenu/getList')
}

export const editApi = (param: MenuType) => {
    return http.put('api/sysMenu', param)
}

export const deleteApi = (menuId: string) => {
    return http.delete(`api/sysMenu/${menuId}`)
}

export const getAssignTreeApi = (param: AssingTreeParam) => {
    return http.get('/api/sysMenu/getAssignTree', param)
}

export const getMenuListApi = (userId: string) => {
    return http.get('/api/sysMenu/getMenuList', {userId: userId})
}